<%@page import="java.util.List"%>
<%@page import="dao.CheckAccount"%>
<%@page import="beans.Account"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Create Class Page</title>
    </head>
    <body>
        <%
            if (request.getAttribute("msg") != null) {
        %>
        <font color="green" > <%= request.getAttribute("msg")%> </font>
        <%
            }
            if (request.getAttribute("error") != null) {
        %>
        <font color="red" > <%= request.getAttribute("error")%> </font>
        <%
            }
        %>

        <form action="createClass" method="get">       
            <table>
                <tr>
                    <td></td>
                    <td>  Add new class</td>
                </tr>
                <tr>
                    <td> Class Name</td>
                    <td> <input type="text" name="class_name" value=""><font color="red">*</font></td>
                </tr>
                <tr>
                    <td> Staff</td>
                    <td>  <select name="acc_id">
                            <option value="">Select Staff</option>
                            <%
                                CheckAccount ck = new CheckAccount();
                                List<Account> list_staff = ck.listAccByRoll("staff");
                                for (Account acc : list_staff) {
                            %>
                            <option value="<%= acc.getAcc_id()%>"><%= acc.getFull_name()%></option>
                            <% }%>
                        </select><font color="red">*</font> 
                    </td>
                </tr>
                <tr>
                    <td> Start Date</td>
                    <td>  <input type="date" name="start_date" value=""></td>
                </tr>
                <tr>
                    <td>  Finish Date</td>
                    <td> <input type="date" name="finish_date" value=""></td>
                </tr>
                <tr>
                    <td>  Description</td>
                    <td> <input type="text" name="description" value=""></td>
                </tr>
                <tr>
                    <td></td>
                    <td> <input type="submit" value="Create"></td>
                </tr>
            </table>
        </form>
    </body>
</html>
